﻿#region
/*******************************************************************************
** File Name:		    AliMaMaRepository.cs
** Creator:		        chao.jiang 
** EMail:               chao.jiang 
** Create date:	        
** Latest Modifier:
** Latest Modify date:
** Description:		    
** Modify History:
**
** Code Review:
**
** Version number:       1.0.0
*********************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using Phoenix.Entity;
using Phoenix.Respository;
using IBatisNet.DataMapper;
using Phoenix.Data.IBatis;

namespace Phoenix.IBatisRepository
{
    public class AliMaMaRepository : BaseIBatisDao,IAliMaMa
    {
    
		#region  Auto Generation

        public AliMaMaRepository()
            : base("/Config/IBatis/86TCMap.Config")
        {

        }
        		
        public void AddAliMaMa(EAliMaMa entity)
        {
			string stmtId = "AliMaMaMap.InsertAliMaMa";
			base.SqlMapper.Insert(stmtId, entity);
        }
        
		public  EAliMaMa GetByMMID (System.Int32 mMID)
        {
			string stmtId = "AliMaMaMap.SelectByMMID";
			return base.SqlMapper.QueryForObject<EAliMaMa>(stmtId, mMID);
        }
        
        public  void DeleteByMMID (System.Int32 mMID)
        {
			string stmtId = "AliMaMaMap.DeleteByMMID";
			base.SqlMapper.Update(stmtId, mMID);
        }
        
        public  void UpdateByMMID (EAliMaMa entity)
        {
			string stmtId = "AliMaMaMap.UpdateByMMID";
			base.SqlMapper.Update(stmtId, entity);
        }


		public  IList<EAliMaMa> GetAll ()
        {
			string stmtId = "AliMaMaMap.SelectAll";
			return base.SqlMapper.QueryForList<EAliMaMa>(stmtId,null);
        }

		#endregion

        public IList<EAliMaMa> GetByProductID(int productID)
        {
            string stmtId = "AliMaMaMap.SelectByProductID";
            return base.SqlMapper.QueryForList<EAliMaMa>(stmtId, productID);
        }
    }
}

